home *** CD-ROM | disk | FTP | other *** search
/ Complete RPG Maker XP - 41 Games / tg esp 48 rpg maker.iso / RPG3D / Tools_Utilities / Quark.exe / Quark / help / zips / OOP_examples.ZIP / figures.py < prev    next >
Encoding:
Python Source  |  2003-04-28  |  488 b   |  25 lines

  1. import math
  2.  
  3. class Figure:
  4.     def __init__(self, x, y ,z):
  5.         self.x = x
  6.         self.y = y
  7.         self.z = z
  8.         
  9.     def origin(self):
  10.         return self.x, self.y, self.z
  11.  
  12. class Point(Figure):
  13.     pass
  14.  
  15. class Circle(Figure):
  16.     def __init__(x, y, z, r):
  17.         Figure.__init__(self, x, y, z)
  18.         self.radius = r
  19.         
  20.     def circumference(self):
  21.         return self.radius*math.pi
  22.         
  23.     def radius(self):
  24.         return self.radius
  25.